package cn.edu.lzzy.dao;

import cn.edu.lzzy.entities.Applicant;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.UUID;

public interface ApplicantRepository extends JpaRepository<Applicant, UUID> {
//根据学生用户id获取其所有的申请
    List<Applicant> findApplicantsByStudentIdEqualsOrderByApplyTimeDesc(UUID id);
//根据学生用户id和申请状态，获取对应的申请
    List<Applicant> findApplicantsByStudentIdEqualsAnAndStatusOrderByApplyTimeDesc(UUID id,int status);
    //根据课程的id获取其所有的申请
    List<Applicant> findApplicantsByCourseIdEqualsOrderByApplyTimeDesc(UUID id);
    //根据学生课程id和申请状态，获取对应的申请
    List<Applicant> findApplicantsByCourseIdEqualsAndStatusOrderByApplyTimeDesc(UUID id);
    //根据课程id和学生id获取申请，针对学生获取课程申请的情景
    Applicant findApplicantsByCourseIdAndStudentId(UUID courseId,UUID studentId);

}
